home *** CD-ROM | disk | FTP | other *** search
- 10 'NAMES2.BAS - Read in ten names from a disk file and store in memory
- 20 'From the GWBT06 Basic Tutorial Series 11/15/1990
- 30 '
- 40 'Variables used:
- 50 DIM NAMES$(10)
- 60 '
- 70 'Start of Main Program:
- 80 OPEN "NAMES.TXT" FOR INPUT AS #1
- 90 INPUT #1,NAMES$(1)
- 100 INPUT #1,NAMES$(2)
- 110 INPUT #1,NAMES$(3)
- 120 INPUT #1,NAMES$(4)
- 130 INPUT #1,NAMES$(5)
- 140 INPUT #1,NAMES$(6)
- 150 INPUT #1,NAMES$(7)
- 160 INPUT #1,NAMES$(8)
- 170 INPUT #1,NAMES$(9)
- 180 INPUT #1,NAMES$(10)
- 190 CLOSE #1
- 200 'Names read in, now let's print them to the screen and get a choice...
- 210 CLS
- 220 PRINT "1 - ";NAMES$(1)
- 230 PRINT "2 - ";NAMES$(2)
- 240 PRINT "3 - ";NAMES$(3)
- 250 PRINT "4 - ";NAMES$(4)
- 260 PRINT "5 - ";NAMES$(5)
- 270 PRINT "6 - ";NAMES$(6)
- 280 PRINT "7 - ";NAMES$(7)
- 290 PRINT "8 - ";NAMES$(8)
- 300 PRINT "9 - ";NAMES$(9)
- 310 PRINT "10- ";NAMES$(10)
- 320 INPUT "Enter a number from 1 to 10 for the desired name";NAMENUMBER
- 330 PRINT "Your selected name is: ";NAMES$(NAMENUMBER)
- 340 END
- 350 'End of program - NAME1.BAS